Fix #5340: Allow restart of jobs with JobParameterIncrementer from command line#5353
Closed
nikitanagar08 wants to merge 1 commit into
Closed
Conversation
9b9099d to
c658476
Compare
…ementer from command line This commit addresses the issue where jobs using JobParameterIncrementer could not be restarted from the command line. Previously, the start() method would always use the incrementer to create a new instance, even when there was a failed/stopped job instance that could be restarted. Changes: - Modified SimpleJobOperator.start() to first try running the job with provided parameters (which restarts failed/stopped instances) - Only use the incrementer when JobInstanceAlreadyCompleteException is thrown (meaning the job instance is already complete) This allows jobs with JobParameterIncrementer to be restarted from the command line when they fail or stop, while still creating new instances when the previous instance is complete. Signed-off-by: Nikita Nagar <[email protected]>
c658476 to
2d3d617
Compare
Contributor
|
Thank you for the PR. As explained in #5340, it is intended to not attempt a restart behind a start operation. Moreover, this change uses an exception for a normal execution flow (we should not attempt to run the job and then start the next instance if the first attempt throws an exception). For these reasons, I am closing this PR. Thank you for your time anyway! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses #5340 by fixing the restart behavior for jobs using
JobParameterIncrementerwhen launched from the command line.Problem
Previously, when a job with a
JobParameterIncrementerwas launched from the command line, thestart()method would always use the incrementer to create a new instance, even when there was a failed/stopped job instance that could be restarted.Solution
Modified
SimpleJobOperator.start()to:JobInstanceAlreadyCompleteExceptionis thrownBehavior Change
This maintains backward compatibility while enabling the expected restart behavior.